package com.zt.springcloud.controller;

import cloud.zt.springboot.utils.ResultUtils;
import com.zt.springcloud.service.Impl.FoodServiceImpl;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author RedReins
 * @version 1.0
 * @description: TODO
 * @date 2021/9/4 14:51
 */

@RestController
public class FoodController {
    @Resource
    private FoodServiceImpl foodService;

    @RequestMapping("/foodProduct/xiuxian")
    public ResultUtils<?> getAllItem(){
        return ResultUtils.success(foodService.getAllItem());
    }

    @RequestMapping("/info/{productId}")
    public ResultUtils<?> getItemInfo(@PathVariable("productId") Long productId){
        return ResultUtils.success(foodService.getItemInfo(productId));
    }
}
